package com.aletto.demo_android_web3j;

import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.web3j.abi.EventEncoder;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.abi.datatypes.generated.Uint8;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.BaseEventResponse;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tuples.generated.Tuple9;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/web3j/web3j/tree/main/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 1.6.0.
 */
@SuppressWarnings("rawtypes")
public class Market extends Contract {
    public static final String BINARY = "608060405234801561000f575f80fd5b5060405161334a38038061334a83398181016040528101906100319190610788565b61003f61042460201b60201c565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100af575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100a69190610803565b60405180910390fd5b6100be8161042b60201b60201c565b50600180819055508260025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f5b82518110156102cd575f8382815181106101255761012461081c565b5b602002602001015190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361019d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610194906108a3565b60405180910390fd5b60035f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615610227576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021e9061090b565b60405180910390fd5b600160035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167ffc4dfef69004b5e3aba1eb4a8b1e53b893418fda232d9f60574a6c62f30c449d60405160405180910390a2508080600101915050610108565b50805f600281106102e1576102e061081c565b5b602002015160045f8060018111156102fc576102fb610929565b5b600181111561030e5761030d610929565b5b81526020019081526020015f2081905550806001600281106103335761033261081c565b5b602002015160045f60018081111561034e5761034d610929565b5b60018111156103605761035f610929565b5b81526020019081526020015f208190555060016006819055507f70f391e53600529f41b44e06737b88e9f314d4b6903f01552d33c8c50d052fca60045f8060018111156103b0576103af610929565b5b60018111156103c2576103c1610929565b5b81526020019081526020015f205460045f6001808111156103e6576103e5610929565b5b60018111156103f8576103f7610929565b5b81526020019081526020015f2054604051610414929190610965565b60405180910390a150505061098c565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610526826104fd565b9050919050565b6105368161051c565b8114610540575f80fd5b50565b5f815190506105518161052d565b92915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6105a18261055b565b810181811067ffffffffffffffff821117156105c0576105bf61056b565b5b80604052505050565b5f6105d26104ec565b90506105de8282610598565b919050565b5f67ffffffffffffffff8211156105fd576105fc61056b565b5b602082029050602081019050919050565b5f80fd5b5f61062461061f846105e3565b6105c9565b905080838252602082019050602084028301858111156106475761064661060e565b5b835b81811015610670578061065c8882610543565b845260208401935050602081019050610649565b5050509392505050565b5f82601f83011261068e5761068d610557565b5b815161069e848260208601610612565b91505092915050565b5f67ffffffffffffffff8211156106c1576106c061056b565b5b602082029050919050565b5f819050919050565b6106de816106cc565b81146106e8575f80fd5b50565b5f815190506106f9816106d5565b92915050565b5f61071161070c846106a7565b6105c9565b9050806020840283018581111561072b5761072a61060e565b5b835b81811015610754578061074088826106eb565b84526020840193505060208101905061072d565b5050509392505050565b5f82601f83011261077257610771610557565b5b600261077f8482856106ff565b91505092915050565b5f805f6080848603121561079f5761079e6104f5565b5b5f6107ac86828701610543565b935050602084015167ffffffffffffffff8111156107cd576107cc6104f9565b5b6107d98682870161067a565b92505060406107ea8682870161075e565b9150509250925092565b6107fd8161051c565b82525050565b5f6020820190506108165f8301846107f4565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82825260208201905092915050565b7f696e76616c69642061726269747261746f7200000000000000000000000000005f82015250565b5f61088d601283610849565b915061089882610859565b602082019050919050565b5f6020820190508181035f8301526108ba81610881565b9050919050565b7f61726269747261746f7220616c726561647920657869737473000000000000005f82015250565b5f6108f5601983610849565b9150610900826108c1565b602082019050919050565b5f6020820190508181035f830152610922816108e9565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b61095f816106cc565b82525050565b5f6040820190506109785f830185610956565b6109856020830184610956565b9392505050565b6129b1806109995f395ff3fe608060405234801561000f575f80fd5b5060043610610109575f3560e01c8063715018a6116100a0578063973ad2701161006f578063973ad27014610279578063a21b3e3f14610295578063a85c38ef146102b1578063e560c021146102e9578063f2fde38b1461030557610109565b8063715018a6146102195780637512bd6a146102235780637e6232711461023f5780638da5cb5b1461025b57610109565b8063494c3d91116100dc578063494c3d91146101815780634bbcb4211461019d57806351d0ea37146101b95780636708c476146101e957610109565b806301fabd751461010d578063278ecde1146101295780632a58b330146101455780632f48ab7d14610163575b5f80fd5b61012760048036038101906101229190611c2f565b610321565b005b610143600480360381019061013e9190611c8d565b61044e565b005b61014d61068a565b60405161015a9190611cc7565b60405180910390f35b61016b610690565b6040516101789190611d3b565b60405180910390f35b61019b60048036038101906101969190611d77565b6106b5565b005b6101b760048036038101906101b29190611c8d565b610b13565b005b6101d360048036038101906101ce9190611c2f565b610cfd565b6040516101e09190611e08565b60405180910390f35b61020360048036038101906101fe9190611e21565b610d1a565b6040516102109190611cc7565b60405180910390f35b610221610d2f565b005b61023d60048036038101906102389190611f8a565b610d42565b005b61025960048036038101906102549190611c8d565b610e93565b005b610263611023565b6040516102709190611fc4565b60405180910390f35b610293600480360381019061028e9190611c2f565b61104a565b005b6102af60048036038101906102aa9190612007565b611175565b005b6102cb60048036038101906102c69190611c8d565b6113cb565b6040516102e0999897969594939291906120fe565b60405180910390f35b61030360048036038101906102fe9190611c8d565b61146c565b005b61031f600480360381019061031a9190611c2f565b611661565b005b6103296116e5565b60035f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16156103b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103aa906121e3565b60405180910390fd5b600160035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167ffc4dfef69004b5e3aba1eb4a8b1e53b893418fda232d9f60574a6c62f30c449d60405160405180910390a250565b61045661176c565b5f60055f8381526020019081526020015f2090506002600381111561047e5761047d612045565b5b816001015f9054906101000a900460ff1660038111156104a1576104a0612045565b5b146104e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d890612271565b60405180910390fd5b806005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105236117b2565b73ffffffffffffffffffffffffffffffffffffffff1614610579576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610570906122d9565b60405180910390fd5b5f8160040154826003015461058e9190612324565b90506105df60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836006015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836117b9565b6003826001015f6101000a81548160ff0219169083600381111561060657610605612045565b5b0217905550816006015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16837f104623e11453a2208930a0e10272ca916a95a34440fe20fdda63c54f716bda61836040516106759190611cc7565b60405180910390a35050610687611838565b50565b60065481565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106bd61176c565b5f84116106ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f6906123af565b60405180910390fd5b5f8311610741576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073890612417565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036107af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a69061247f565b60405180910390fd5b6107b76117b2565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b906124e7565b60405180910390fd5b5f60065490505f60045f85600181111561084157610840612045565b5b600181111561085357610852612045565b5b81526020019081526020015f20544261086c9190612505565b90505f858761087b9190612324565b90506108b160025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166108aa6117b2565b3084611841565b604051806101200160405280848152602001600160038111156108d7576108d6612045565b5b81526020018660018111156108ef576108ee612045565b5b81526020018981526020018881526020018781526020018573ffffffffffffffffffffffffffffffffffffffff16815260200161092a6117b2565b73ffffffffffffffffffffffffffffffffffffffff1681526020018381525060055f8581526020019081526020015f205f820151815f01556020820151816001015f6101000a81548160ff0219169083600381111561098c5761098b612045565b5b021790555060408201518160010160016101000a81548160ff021916908360018111156109bc576109bb612045565b5b0217905550606082015181600201556080820151816003015560a0820151816004015560c0820151816005015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e0820151816006015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610100820151816007015590505060065f815480929190610a8b90612538565b9190505550610a986117b2565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16847f1490d542134539bf857ad28e4aa41fc82cddefc5ba8d997e222731355fbee9f68b8587604051610af99392919061257f565b60405180910390a4505050610b0c611838565b5050505050565b610b1b61176c565b5f60055f8381526020019081526020015f20905060016003811115610b4357610b42612045565b5b816001015f9054906101000a900460ff166003811115610b6657610b65612045565b5b14610ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9d906125fe565b60405180910390fd5b80600701544211610bec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be390612666565b60405180910390fd5b6003816001015f6101000a81548160ff02191690836003811115610c1357610c12612045565b5b02179055505f81600401548260030154610c2d9190612324565b9050610c7e60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836117b9565b816005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16837ffadeaab2fa42ff4d9ec32d971b8968fe249bfa75c5d53c3267b5789857ac50b283604051610ce89190611cc7565b60405180910390a35050610cfa611838565b50565b6003602052805f5260405f205f915054906101000a900460ff1681565b6004602052805f5260405f205f915090505481565b610d376116e5565b610d405f6118c3565b565b610d4a6116e5565b805f60028110610d5d57610d5c612684565b5b602002015160045f806001811115610d7857610d77612045565b5b6001811115610d8a57610d89612045565b5b81526020019081526020015f208190555080600160028110610daf57610dae612684565b5b602002015160045f600180811115610dca57610dc9612045565b5b6001811115610ddc57610ddb612045565b5b81526020019081526020015f20819055507f70f391e53600529f41b44e06737b88e9f314d4b6903f01552d33c8c50d052fca60045f806001811115610e2457610e23612045565b5b6001811115610e3657610e35612045565b5b81526020019081526020015f205460045f600180811115610e5a57610e59612045565b5b6001811115610e6c57610e6b612045565b5b81526020019081526020015f2054604051610e889291906126b1565b60405180910390a150565b610e9b61176c565b5f60055f8381526020019081526020015f20905060026003811115610ec357610ec2612045565b5b816001015f9054906101000a900460ff166003811115610ee657610ee5612045565b5b14610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90612271565b60405180910390fd5b806006015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f686117b2565b73ffffffffffffffffffffffffffffffffffffffff1614610fbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb590612722565b60405180910390fd5b6001816001015f6101000a81548160ff02191690836003811115610fe557610fe4612045565b5b0217905550817f253d9a061bbb651649a48635a92b108b4eec1ba04a1725688d996c9f793be99760405160405180910390a250611020611838565b50565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6110526116e5565b60035f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff166110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d29061278a565b60405180910390fd5b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f715484adb5bc9cc29af577725dbf8486d0b82eca3ba79f65846e92ff38ef32b560405160405180910390a250565b61117d61176c565b60035f6111886117b2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1661120d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611204906127f2565b60405180910390fd5b5f60055f8481526020019081526020015f2090506002600381111561123557611234612045565b5b816001015f9054906101000a900460ff16600381111561125857611257612045565b5b14611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90612271565b60405180910390fd5b5f816004015482600301546112ad9190612324565b905082156113095761130460025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836117b9565b611359565b61135860025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836006015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836117b9565b5b6003826001015f6101000a81548160ff021916908360038111156113805761137f612045565b5b0217905550837f3ed70114070e0fb187c03b2ef5f508d6c88ab0b8b388c35d5cbf1cf5c83386ca846040516113b59190611e08565b60405180910390a250506113c7611838565b5050565b6005602052805f5260405f205f91509050805f015490806001015f9054906101000a900460ff16908060010160019054906101000a900460ff1690806002015490806003015490806004015490806005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806006015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060070154905089565b61147461176c565b5f60055f8381526020019081526020015f209050806006015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114ca6117b2565b73ffffffffffffffffffffffffffffffffffffffff1614611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151790612722565b60405180910390fd5b6001600381111561153457611533612045565b5b816001015f9054906101000a900460ff16600381111561155757611556612045565b5b14611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e906125fe565b60405180910390fd5b80600701544211156115de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d59061285a565b60405180910390fd5b6002816001015f6101000a81548160ff0219169083600381111561160557611604612045565b5b02179055506116126117b2565b73ffffffffffffffffffffffffffffffffffffffff16827f985daff67bea199547802d76da8d42b80f35df933703445a5c105e73b90378b060405160405180910390a35061165e611838565b50565b6116696116e5565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116d9575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016116d09190611fc4565b60405180910390fd5b6116e2816118c3565b50565b6116ed6117b2565b73ffffffffffffffffffffffffffffffffffffffff1661170b611023565b73ffffffffffffffffffffffffffffffffffffffff161461176a5761172e6117b2565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016117619190611fc4565b60405180910390fd5b565b6002600154036117a8576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b5f33905090565b611833838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016117ec929190612878565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611984565b505050565b60018081905550565b6118bd848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016118769392919061289f565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611984565b50505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f6119ae828473ffffffffffffffffffffffffffffffffffffffff16611a1990919063ffffffff16565b90505f8151141580156119d25750808060200190518101906119d091906128e8565b155b15611a1457826040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401611a0b9190611fc4565b60405180910390fd5b505050565b6060611a2683835f611a2e565b905092915050565b606081471015611a7557306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401611a6c9190611fc4565b60405180910390fd5b5f808573ffffffffffffffffffffffffffffffffffffffff168486604051611a9d9190612965565b5f6040518083038185875af1925050503d805f8114611ad7576040519150601f19603f3d011682016040523d82523d5f602084013e611adc565b606091505b5091509150611aec868383611af7565b925050509392505050565b606082611b0c57611b0782611b84565b611b7c565b5f8251148015611b3257505f8473ffffffffffffffffffffffffffffffffffffffff163b145b15611b7457836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401611b6b9190611fc4565b60405180910390fd5b819050611b7d565b5b9392505050565b5f81511115611b965780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051905090565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611bfe82611bd5565b9050919050565b611c0e81611bf4565b8114611c18575f80fd5b50565b5f81359050611c2981611c05565b92915050565b5f60208284031215611c4457611c43611bd1565b5b5f611c5184828501611c1b565b91505092915050565b5f819050919050565b611c6c81611c5a565b8114611c76575f80fd5b50565b5f81359050611c8781611c63565b92915050565b5f60208284031215611ca257611ca1611bd1565b5b5f611caf84828501611c79565b91505092915050565b611cc181611c5a565b82525050565b5f602082019050611cda5f830184611cb8565b92915050565b5f819050919050565b5f611d03611cfe611cf984611bd5565b611ce0565b611bd5565b9050919050565b5f611d1482611ce9565b9050919050565b5f611d2582611d0a565b9050919050565b611d3581611d1b565b82525050565b5f602082019050611d4e5f830184611d2c565b92915050565b60028110611d60575f80fd5b50565b5f81359050611d7181611d54565b92915050565b5f805f805f60a08688031215611d9057611d8f611bd1565b5b5f611d9d88828901611c79565b9550506020611dae88828901611c79565b9450506040611dbf88828901611c79565b9350506060611dd088828901611d63565b9250506080611de188828901611c1b565b9150509295509295909350565b5f8115159050919050565b611e0281611dee565b82525050565b5f602082019050611e1b5f830184611df9565b92915050565b5f60208284031215611e3657611e35611bd1565b5b5f611e4384828501611d63565b91505092915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611e9682611e50565b810181811067ffffffffffffffff82111715611eb557611eb4611e60565b5b80604052505050565b5f611ec7611bc8565b9050611ed38282611e8d565b919050565b5f67ffffffffffffffff821115611ef257611ef1611e60565b5b602082029050919050565b5f80fd5b5f611f13611f0e84611ed8565b611ebe565b90508060208402830185811115611f2d57611f2c611efd565b5b835b81811015611f565780611f428882611c79565b845260208401935050602081019050611f2f565b5050509392505050565b5f82601f830112611f7457611f73611e4c565b5b6002611f81848285611f01565b91505092915050565b5f60408284031215611f9f57611f9e611bd1565b5b5f611fac84828501611f60565b91505092915050565b611fbe81611bf4565b82525050565b5f602082019050611fd75f830184611fb5565b92915050565b611fe681611dee565b8114611ff0575f80fd5b50565b5f8135905061200181611fdd565b92915050565b5f806040838503121561201d5761201c611bd1565b5b5f61202a85828601611c79565b925050602061203b85828601611ff3565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6004811061208357612082612045565b5b50565b5f81905061209382612072565b919050565b5f6120a282612086565b9050919050565b6120b281612098565b82525050565b600281106120c9576120c8612045565b5b50565b5f8190506120d9826120b8565b919050565b5f6120e8826120cc565b9050919050565b6120f8816120de565b82525050565b5f610120820190506121125f83018c611cb8565b61211f602083018b6120a9565b61212c604083018a6120ef565b6121396060830189611cb8565b6121466080830188611cb8565b61215360a0830187611cb8565b61216060c0830186611fb5565b61216d60e0830185611fb5565b61217b610100830184611cb8565b9a9950505050505050505050565b5f82825260208201905092915050565b7f61726269747261746f7220616c726561647920657869737473000000000000005f82015250565b5f6121cd601983612189565b91506121d882612199565b602082019050919050565b5f6020820190508181035f8301526121fa816121c1565b9050919050565b7f6d75737420626520574149545f464f525f4152424954524154452073746174755f8201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b5f61225b602183612189565b915061226682612201565b604082019050919050565b5f6020820190508181035f8301526122888161224f565b9050919050565b7f6d7573742062652073656c6c65720000000000000000000000000000000000005f82015250565b5f6122c3600e83612189565b91506122ce8261228f565b602082019050919050565b5f6020820190508181035f8301526122f0816122b7565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61232e82611c5a565b915061233983611c5a565b925082820261234781611c5a565b9150828204841483151761235e5761235d6122f7565b5b5092915050565b7f7072696365206d7573742062652067726561746572207468616e207a65726f005f82015250565b5f612399601f83612189565b91506123a482612365565b602082019050919050565b5f6020820190508181035f8301526123c68161238d565b9050919050565b7f6e756d626572206d7573742062652067726561746572207468616e207a65726f5f82015250565b5f612401602083612189565b915061240c826123cd565b602082019050919050565b5f6020820190508181035f83015261242e816123f5565b9050919050565b7f73656c6c65722061646472657373206973206e6f7420656d70747900000000005f82015250565b5f612469601b83612189565b915061247482612435565b602082019050919050565b5f6020820190508181035f8301526124968161245d565b9050919050565b7f73656c6c6572206d757374206e6f7420626520627579657200000000000000005f82015250565b5f6124d1601883612189565b91506124dc8261249d565b602082019050919050565b5f6020820190508181035f8301526124fe816124c5565b9050919050565b5f61250f82611c5a565b915061251a83611c5a565b9250828201905080821115612532576125316122f7565b5b92915050565b5f61254282611c5a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612574576125736122f7565b5b600182019050919050565b5f6060820190506125925f830186611cb8565b61259f6020830185611cb8565b6125ac6040830184611cb8565b949350505050565b7f6d75737420626520574149545f464f525f4d41545552452073746174757300005f82015250565b5f6125e8601e83612189565b91506125f3826125b4565b602082019050919050565b5f6020820190508181035f830152612615816125dc565b9050919050565b7f6e6f74206d6174757265207965740000000000000000000000000000000000005f82015250565b5f612650600e83612189565b915061265b8261261c565b602082019050919050565b5f6020820190508181035f83015261267d81612644565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f6040820190506126c45f830185611cb8565b6126d16020830184611cb8565b9392505050565b7f6d757374206265206275796572000000000000000000000000000000000000005f82015250565b5f61270c600d83612189565b9150612717826126d8565b602082019050919050565b5f6020820190508181035f83015261273981612700565b9050919050565b7f61726269747261746f72206e6f742065786973747300000000000000000000005f82015250565b5f612774601583612189565b915061277f82612740565b602082019050919050565b5f6020820190508181035f8301526127a181612768565b9050919050565b7f6e6f7420612061726269747261746f72000000000000000000000000000000005f82015250565b5f6127dc601083612189565b91506127e7826127a8565b602082019050919050565b5f6020820190508181035f830152612809816127d0565b9050919050565b7f686173206265656e206d617475726564000000000000000000000000000000005f82015250565b5f612844601083612189565b915061284f82612810565b602082019050919050565b5f6020820190508181035f83015261287181612838565b9050919050565b5f60408201905061288b5f830185611fb5565b6128986020830184611cb8565b9392505050565b5f6060820190506128b25f830186611fb5565b6128bf6020830185611fb5565b6128cc6040830184611cb8565b949350505050565b5f815190506128e281611fdd565b92915050565b5f602082840312156128fd576128fc611bd1565b5b5f61290a848285016128d4565b91505092915050565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f61293f82612913565b612949818561291d565b9350612959818560208601612927565b80840191505092915050565b5f6129708284612935565b91508190509291505056fea26469706673582212203f26749a600e09d64d3af72cdd1ac080c98be9a0980e0f37871b8966c82d423c64736f6c63430008190033\n"
            + "~\n";

    private static String librariesLinkedBinary;

    public static final String FUNC_ADDARBITRATOR = "addArbitrator";

    public static final String FUNC_ARBITRATORS = "arbitrators";

    public static final String FUNC_BUY = "buy";

    public static final String FUNC_CANCELARBITRATION = "cancelArbitration";

    public static final String FUNC_CHANGEMATURETIMES = "changeMatureTimes";

    public static final String FUNC_MATURETIMES = "matureTimes";

    public static final String FUNC_NEXTORDERID = "nextOrderId";

    public static final String FUNC_ORDERS = "orders";

    public static final String FUNC_OWNER = "owner";

    public static final String FUNC_RAISEARBITRATION = "raiseArbitration";

    public static final String FUNC_REFUND = "refund";

    public static final String FUNC_REMOVEARBITRATOR = "removeArbitrator";

    public static final String FUNC_RENOUNCEOWNERSHIP = "renounceOwnership";

    public static final String FUNC_RESOLVEARBITRATION = "resolveArbitration";

    public static final String FUNC_TAKEFUND = "takeFund";

    public static final String FUNC_TRANSFEROWNERSHIP = "transferOwnership";

    public static final String FUNC_USDT = "usdt";

    public static final Event ARBITRATIONCANCELLED_EVENT = new Event("ArbitrationCancelled", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}));
    ;

    public static final Event ARBITRATIONRAISED_EVENT = new Event("ArbitrationRaised", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event ARBITRATIONREFUND_EVENT = new Event("ArbitrationRefund", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event ARBITRATIONRESOLVED_EVENT = new Event("ArbitrationResolved", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}, new TypeReference<Bool>() {}));
    ;

    public static final Event ARBITRATORADDED_EVENT = new Event("ArbitratorAdded", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}));
    ;

    public static final Event ARBITRATORREMOVED_EVENT = new Event("ArbitratorRemoved", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}));
    ;

    public static final Event BUY_EVENT = new Event("Buy", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event FUNDTAKEN_EVENT = new Event("FundTaken", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event MATURETIMECHANGED_EVENT = new Event("MatureTimeChanged", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event OWNERSHIPTRANSFERRED_EVENT = new Event("OwnershipTransferred", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}));
    ;

    @Deprecated
    protected Market(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected Market(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected Market(String contractAddress, Web3j web3j, TransactionManager transactionManager,
            BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected Market(String contractAddress, Web3j web3j, TransactionManager transactionManager,
            ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

//    public static List<ArbitrationCancelledEventResponse> getArbitrationCancelledEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ARBITRATIONCANCELLED_EVENT, transactionReceipt);
//        ArrayList<ArbitrationCancelledEventResponse> responses = new ArrayList<ArbitrationCancelledEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            ArbitrationCancelledEventResponse typedResponse = new ArbitrationCancelledEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ArbitrationCancelledEventResponse getArbitrationCancelledEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ARBITRATIONCANCELLED_EVENT, log);
        ArbitrationCancelledEventResponse typedResponse = new ArbitrationCancelledEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<ArbitrationCancelledEventResponse> arbitrationCancelledEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getArbitrationCancelledEventFromLog(log));
    }

    public Flowable<ArbitrationCancelledEventResponse> arbitrationCancelledEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ARBITRATIONCANCELLED_EVENT));
        return arbitrationCancelledEventFlowable(filter);
    }

//    public static List<ArbitrationRaisedEventResponse> getArbitrationRaisedEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ARBITRATIONRAISED_EVENT, transactionReceipt);
//        ArrayList<ArbitrationRaisedEventResponse> responses = new ArrayList<ArbitrationRaisedEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            ArbitrationRaisedEventResponse typedResponse = new ArbitrationRaisedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ArbitrationRaisedEventResponse getArbitrationRaisedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ARBITRATIONRAISED_EVENT, log);
        ArbitrationRaisedEventResponse typedResponse = new ArbitrationRaisedEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<ArbitrationRaisedEventResponse> arbitrationRaisedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getArbitrationRaisedEventFromLog(log));
    }

    public Flowable<ArbitrationRaisedEventResponse> arbitrationRaisedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ARBITRATIONRAISED_EVENT));
        return arbitrationRaisedEventFlowable(filter);
    }

//    public static List<ArbitrationRefundEventResponse> getArbitrationRefundEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ARBITRATIONREFUND_EVENT, transactionReceipt);
//        ArrayList<ArbitrationRefundEventResponse> responses = new ArrayList<ArbitrationRefundEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            ArbitrationRefundEventResponse typedResponse = new ArbitrationRefundEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.param2 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ArbitrationRefundEventResponse getArbitrationRefundEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ARBITRATIONREFUND_EVENT, log);
        ArbitrationRefundEventResponse typedResponse = new ArbitrationRefundEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.param2 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<ArbitrationRefundEventResponse> arbitrationRefundEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getArbitrationRefundEventFromLog(log));
    }

    public Flowable<ArbitrationRefundEventResponse> arbitrationRefundEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ARBITRATIONREFUND_EVENT));
        return arbitrationRefundEventFlowable(filter);
    }

//    public static List<ArbitrationResolvedEventResponse> getArbitrationResolvedEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ARBITRATIONRESOLVED_EVENT, transactionReceipt);
//        ArrayList<ArbitrationResolvedEventResponse> responses = new ArrayList<ArbitrationResolvedEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            ArbitrationResolvedEventResponse typedResponse = new ArbitrationResolvedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.param1 = (Boolean) eventValues.getNonIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ArbitrationResolvedEventResponse getArbitrationResolvedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ARBITRATIONRESOLVED_EVENT, log);
        ArbitrationResolvedEventResponse typedResponse = new ArbitrationResolvedEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.param1 = (Boolean) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<ArbitrationResolvedEventResponse> arbitrationResolvedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getArbitrationResolvedEventFromLog(log));
    }

    public Flowable<ArbitrationResolvedEventResponse> arbitrationResolvedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ARBITRATIONRESOLVED_EVENT));
        return arbitrationResolvedEventFlowable(filter);
    }

//    public static List<ArbitratorAddedEventResponse> getArbitratorAddedEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ARBITRATORADDED_EVENT, transactionReceipt);
//        ArrayList<ArbitratorAddedEventResponse> responses = new ArrayList<ArbitratorAddedEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            ArbitratorAddedEventResponse typedResponse = new ArbitratorAddedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (String) eventValues.getIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ArbitratorAddedEventResponse getArbitratorAddedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ARBITRATORADDED_EVENT, log);
        ArbitratorAddedEventResponse typedResponse = new ArbitratorAddedEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (String) eventValues.getIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<ArbitratorAddedEventResponse> arbitratorAddedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getArbitratorAddedEventFromLog(log));
    }

    public Flowable<ArbitratorAddedEventResponse> arbitratorAddedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ARBITRATORADDED_EVENT));
        return arbitratorAddedEventFlowable(filter);
    }

//    public static List<ArbitratorRemovedEventResponse> getArbitratorRemovedEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ARBITRATORREMOVED_EVENT, transactionReceipt);
//        ArrayList<ArbitratorRemovedEventResponse> responses = new ArrayList<ArbitratorRemovedEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            ArbitratorRemovedEventResponse typedResponse = new ArbitratorRemovedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (String) eventValues.getIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ArbitratorRemovedEventResponse getArbitratorRemovedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ARBITRATORREMOVED_EVENT, log);
        ArbitratorRemovedEventResponse typedResponse = new ArbitratorRemovedEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (String) eventValues.getIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<ArbitratorRemovedEventResponse> arbitratorRemovedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getArbitratorRemovedEventFromLog(log));
    }

    public Flowable<ArbitratorRemovedEventResponse> arbitratorRemovedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ARBITRATORREMOVED_EVENT));
        return arbitratorRemovedEventFlowable(filter);
    }

//    public static List<BuyEventResponse> getBuyEvents(TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(BUY_EVENT, transactionReceipt);
//        ArrayList<BuyEventResponse> responses = new ArrayList<BuyEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            BuyEventResponse typedResponse = new BuyEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.param2 = (String) eventValues.getIndexedValues().get(2).getValue();
//            typedResponse.param3 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.param4 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            typedResponse.param5 = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static BuyEventResponse getBuyEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BUY_EVENT, log);
        BuyEventResponse typedResponse = new BuyEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.param2 = (String) eventValues.getIndexedValues().get(2).getValue();
        typedResponse.param3 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.param4 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.param5 = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
        return typedResponse;
    }

    public Flowable<BuyEventResponse> buyEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getBuyEventFromLog(log));
    }

    public Flowable<BuyEventResponse> buyEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(BUY_EVENT));
        return buyEventFlowable(filter);
    }

//    public static List<FundTakenEventResponse> getFundTakenEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(FUNDTAKEN_EVENT, transactionReceipt);
//        ArrayList<FundTakenEventResponse> responses = new ArrayList<FundTakenEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            FundTakenEventResponse typedResponse = new FundTakenEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.param2 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static FundTakenEventResponse getFundTakenEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FUNDTAKEN_EVENT, log);
        FundTakenEventResponse typedResponse = new FundTakenEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.param1 = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.param2 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<FundTakenEventResponse> fundTakenEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getFundTakenEventFromLog(log));
    }

    public Flowable<FundTakenEventResponse> fundTakenEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(FUNDTAKEN_EVENT));
        return fundTakenEventFlowable(filter);
    }

//    public static List<MatureTimeChangedEventResponse> getMatureTimeChangedEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(MATURETIMECHANGED_EVENT, transactionReceipt);
//        ArrayList<MatureTimeChangedEventResponse> responses = new ArrayList<MatureTimeChangedEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            MatureTimeChangedEventResponse typedResponse = new MatureTimeChangedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.param0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.param1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static MatureTimeChangedEventResponse getMatureTimeChangedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(MATURETIMECHANGED_EVENT, log);
        MatureTimeChangedEventResponse typedResponse = new MatureTimeChangedEventResponse();
        typedResponse.log = log;
        typedResponse.param0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.param1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<MatureTimeChangedEventResponse> matureTimeChangedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getMatureTimeChangedEventFromLog(log));
    }

    public Flowable<MatureTimeChangedEventResponse> matureTimeChangedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(MATURETIMECHANGED_EVENT));
        return matureTimeChangedEventFlowable(filter);
    }

//    public static List<OwnershipTransferredEventResponse> getOwnershipTransferredEvents(
//            TransactionReceipt transactionReceipt) {
//        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OWNERSHIPTRANSFERRED_EVENT, transactionReceipt);
//        ArrayList<OwnershipTransferredEventResponse> responses = new ArrayList<OwnershipTransferredEventResponse>(valueList.size());
//        for (EventValuesWithLog eventValues : valueList) {
//            OwnershipTransferredEventResponse typedResponse = new OwnershipTransferredEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.newOwner = (String) eventValues.getIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static OwnershipTransferredEventResponse getOwnershipTransferredEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERSHIPTRANSFERRED_EVENT, log);
        OwnershipTransferredEventResponse typedResponse = new OwnershipTransferredEventResponse();
        typedResponse.log = log;
        typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.newOwner = (String) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<OwnershipTransferredEventResponse> ownershipTransferredEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOwnershipTransferredEventFromLog(log));
    }

    public Flowable<OwnershipTransferredEventResponse> ownershipTransferredEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OWNERSHIPTRANSFERRED_EVENT));
        return ownershipTransferredEventFlowable(filter);
    }

    public RemoteFunctionCall<TransactionReceipt> addArbitrator(String _account) {
        final Function function = new Function(
                FUNC_ADDARBITRATOR, 
                Arrays.<Type>asList(new Address(160, _account)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Boolean> arbitrators(String param0) {
        final Function function = new Function(FUNC_ARBITRATORS, 
                Arrays.<Type>asList(new Address(160, param0)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<TransactionReceipt> buy(BigInteger _id, BigInteger _price,
            BigInteger _number, BigInteger _typ, String _seller) {
        final Function function = new Function(
                FUNC_BUY, 
                Arrays.<Type>asList(new Uint256(_id),
                new Uint256(_price),
                new Uint256(_number),
                new Uint8(_typ),
                new Address(160, _seller)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> cancelArbitration(BigInteger _orderId) {
        final Function function = new Function(
                FUNC_CANCELARBITRATION, 
                Arrays.<Type>asList(new Uint256(_orderId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> changeMatureTimes(List<BigInteger> _matureTimes) {
        final Function function = new Function(
                FUNC_CHANGEMATURETIMES, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.StaticArray2<Uint256>(
                        Uint256.class,
                        org.web3j.abi.Utils.typeMap(_matureTimes, Uint256.class))),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> matureTimes(BigInteger param0) {
        final Function function = new Function(FUNC_MATURETIMES, 
                Arrays.<Type>asList(new Uint8(param0)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> nextOrderId() {
        final Function function = new Function(FUNC_NEXTORDERID, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<Tuple9<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String, String, BigInteger>> orders(
            BigInteger param0) {
        final Function function = new Function(FUNC_ORDERS, 
                Arrays.<Type>asList(new Uint256(param0)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint8>() {}, new TypeReference<Uint8>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Uint256>() {}));
        return new RemoteFunctionCall<Tuple9<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String, String, BigInteger>>(function,
                new Callable<Tuple9<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String, String, BigInteger>>() {
                    @Override
                    public Tuple9<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String, String, BigInteger> call(
                            ) throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple9<BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, String, String, BigInteger>(
                                (BigInteger) results.get(0).getValue(), 
                                (BigInteger) results.get(1).getValue(), 
                                (BigInteger) results.get(2).getValue(), 
                                (BigInteger) results.get(3).getValue(), 
                                (BigInteger) results.get(4).getValue(), 
                                (BigInteger) results.get(5).getValue(), 
                                (String) results.get(6).getValue(), 
                                (String) results.get(7).getValue(), 
                                (BigInteger) results.get(8).getValue());
                    }
                });
    }

    public RemoteFunctionCall<String> owner() {
        final Function function = new Function(FUNC_OWNER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<TransactionReceipt> raiseArbitration(BigInteger _orderId) {
        final Function function = new Function(
                FUNC_RAISEARBITRATION, 
                Arrays.<Type>asList(new Uint256(_orderId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> refund(BigInteger _orderId) {
        final Function function = new Function(
                FUNC_REFUND, 
                Arrays.<Type>asList(new Uint256(_orderId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> removeArbitrator(String _account) {
        final Function function = new Function(
                FUNC_REMOVEARBITRATOR, 
                Arrays.<Type>asList(new Address(160, _account)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> renounceOwnership() {
        final Function function = new Function(
                FUNC_RENOUNCEOWNERSHIP, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> resolveArbitration(BigInteger _orderId,
            Boolean _sellerWin) {
        final Function function = new Function(
                FUNC_RESOLVEARBITRATION, 
                Arrays.<Type>asList(new Uint256(_orderId),
                new Bool(_sellerWin)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> takeFund(BigInteger _orderId) {
        final Function function = new Function(
                FUNC_TAKEFUND, 
                Arrays.<Type>asList(new Uint256(_orderId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> transferOwnership(String newOwner) {
        final Function function = new Function(
                FUNC_TRANSFEROWNERSHIP, 
                Arrays.<Type>asList(new Address(160, newOwner)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<String> usdt() {
        final Function function = new Function(FUNC_USDT, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    @Deprecated
    public static Market load(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        return new Market(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static Market load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new Market(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static Market load(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        return new Market(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static Market load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new Market(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<Market> deploy(Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider, String _usdt, List<String> _arbitrators,
            List<BigInteger> _matureTimes) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, _usdt),
                new org.web3j.abi.datatypes.DynamicArray<Address>(
                        Address.class,
                        org.web3j.abi.Utils.typeMap(_arbitrators, Address.class)),
                new org.web3j.abi.datatypes.generated.StaticArray2<Uint256>(
                        Uint256.class,
                        org.web3j.abi.Utils.typeMap(_matureTimes, Uint256.class))));
        return deployRemoteCall(Market.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), encodedConstructor);
    }

    public static RemoteCall<Market> deploy(Web3j web3j, TransactionManager transactionManager,
            ContractGasProvider contractGasProvider, String _usdt, List<String> _arbitrators,
            List<BigInteger> _matureTimes) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, _usdt),
                new org.web3j.abi.datatypes.DynamicArray<Address>(
                        Address.class,
                        org.web3j.abi.Utils.typeMap(_arbitrators, Address.class)),
                new org.web3j.abi.datatypes.generated.StaticArray2<Uint256>(
                        Uint256.class,
                        org.web3j.abi.Utils.typeMap(_matureTimes, Uint256.class))));
        return deployRemoteCall(Market.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<Market> deploy(Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit, String _usdt, List<String> _arbitrators,
            List<BigInteger> _matureTimes) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, _usdt),
                new org.web3j.abi.datatypes.DynamicArray<Address>(
                        Address.class,
                        org.web3j.abi.Utils.typeMap(_arbitrators, Address.class)),
                new org.web3j.abi.datatypes.generated.StaticArray2<Uint256>(
                        Uint256.class,
                        org.web3j.abi.Utils.typeMap(_matureTimes, Uint256.class))));
        return deployRemoteCall(Market.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<Market> deploy(Web3j web3j, TransactionManager transactionManager,
            BigInteger gasPrice, BigInteger gasLimit, String _usdt, List<String> _arbitrators,
            List<BigInteger> _matureTimes) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, _usdt),
                new org.web3j.abi.datatypes.DynamicArray<Address>(
                        Address.class,
                        org.web3j.abi.Utils.typeMap(_arbitrators, Address.class)),
                new org.web3j.abi.datatypes.generated.StaticArray2<Uint256>(
                        Uint256.class,
                        org.web3j.abi.Utils.typeMap(_matureTimes, Uint256.class))));
        return deployRemoteCall(Market.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor);
    }

//    public static void linkLibraries(List<Contract.LinkReference> references) {
//        librariesLinkedBinary = linkBinaryWithReferences(BINARY, references);
//    }

    private static String getDeploymentBinary() {
        if (librariesLinkedBinary != null) {
            return librariesLinkedBinary;
        } else {
            return BINARY;
        }
    }

    public static class ArbitrationCancelledEventResponse extends BaseEventResponse {
        public BigInteger param0;
    }

    public static class ArbitrationRaisedEventResponse extends BaseEventResponse {
        public BigInteger param0;

        public String param1;
    }

    public static class ArbitrationRefundEventResponse extends BaseEventResponse {
        public BigInteger param0;

        public String param1;

        public BigInteger param2;
    }

    public static class ArbitrationResolvedEventResponse extends BaseEventResponse {
        public BigInteger param0;

        public Boolean param1;
    }

    public static class ArbitratorAddedEventResponse extends BaseEventResponse {
        public String param0;
    }

    public static class ArbitratorRemovedEventResponse extends BaseEventResponse {
        public String param0;
    }

    public static class BuyEventResponse extends BaseEventResponse {
        public BigInteger param0;

        public String param1;

        public String param2;

        public BigInteger param3;

        public BigInteger param4;

        public BigInteger param5;
    }

    public static class FundTakenEventResponse extends BaseEventResponse {
        public BigInteger param0;

        public String param1;

        public BigInteger param2;
    }

    public static class MatureTimeChangedEventResponse extends BaseEventResponse {
        public BigInteger param0;

        public BigInteger param1;
    }

    public static class OwnershipTransferredEventResponse extends BaseEventResponse {
        public String previousOwner;

        public String newOwner;
    }
}
